package com.surendra.coffeemaker;
import static org.junit.Assert.*;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;



public class InventoryTest {
public static Inventory inventory;
public static Recipe r;
public CoffeeMaker c;
	@Before
	public void setUp() throws Exception {
		inventory= new Inventory();
		r= new Recipe();
		c= new CoffeeMaker();
	}

	@After
	public void tearDown() throws Exception {
		inventory=null;
		r=null;
		c=null;
	}

	@Test
	public void toStringTest() {
		c.addInventory(4, 4, 4, 4);
		
		String expected="Coffee: " + 19 + "\n" +
				"Milk: " + 19 + "\n" +
				"Sugar: " + 19 + "\n" +
				"Chocolate: " + 19+ "\n";
		assertEquals(expected,inventory.toString());
	}@Test
	/**
	 * tests whether enough ingredients
	 */
public void enoughIngredientsTest(){
		r.setName("Coffee");
		r.setPrice(50);
		r.setAmtCoffee(19);
		r.setAmtMilk(16);
		r.setAmtSugar(16);
		r.setAmtChocolate(17);
		c.addRecipe(r);
		assertFalse(inventory.enoughIngredients(r));
	}
}
